home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / prolog / ai.prl / summers.lha / disease.kb next >
Text File  |  1991-04-02  |  3KB  |  31 lines

  1. zpurpose("This is a DEMO-ONLY knowledge base that helps\ndiagnose diseases.  Do NOT rely on this KB.\nInstead consult your doctor if you think\nyou are sick!")
  2. zfuzzy_set("temperature","dangerous temp",[[98.6,-1],[99,0],[103,0.2],[105,1]])
  3. zfuzzy_set("height","tall",[[5,-1],[6,0.1],[7,1]])
  4. zfuzzy_set("weight of person","heavy",[[150,-1],[180,-0.3],[200,0.1],[300,1]])
  5. zrule("rule #2",[ante("and",[["aches","=","yes"],["temperature","<=","98.6"],["runny nose","=","yes"]])],[conse("disease","=","cold",0.7)])
  6. zrule("rule #3",[ante("or",[["disease","=","flu"],["disease","=","cold"]])],[conse("prescription","=","rest and liquids",0.2),conse("prescription","=","aspirin",0.3),conse("prescription","=","vitamin C",0.4)])
  7. zrule("rule #4",[ante("and",[["aches","=","yes"],["temperature",">=","102"],["back ache","=","yes"]])],[conse("disease","=","spinal mentingitus",0.444)])
  8. zrule("rule #1",[ante("and",[["aches","=","yes"],["temperature",">","98.6"],["back ache","=","no"]])],[conse("disease","=","flu",0.8)])
  9. zrule("rule #5",[ante("and",[["disease","=","spinal mentingitus"]])],[conse("prescription","=","Spinal men. vaccine #7.8",0.34)])
  10. zrule("rule #6",[ante("and",[["temperature","fz>","dangerous temp"]])],[conse("precautions","=","take precautions",0.9)])
  11. zrule("rule #7",[ante("or",[["weight of person","fz=","heavy"],["height","fz=","tall"]])],[conse("large person","=","yes",0.8)])
  12. zrange("temperature",95,110)
  13. zrange("height",0,8)
  14. zrange("weight of person",0,700)
  15. zexplain("temperature","Put a thermometer in the patient's mouth.  After about a minute,\nread the value.  The temperature should around 98.6 degrees for a normal\nperson.  A fever is indicated if the temperature is < 98.6.  If temperature\nis > 101, the person is definitely sick!!!  ")
  16. zconclusion("disease","=","flu","The patient has the flu.  You need to\nmake sure that s/he gets prompt treatment.")
  17. zconclusion("disease","=","cold","The patient has a severe cold.....")
  18. zconclusion("precautions","=","take precautions","The patient has a very high temperature.  You should\ntry to gradually reduce the temperature so his\ninternal organs will work properly.  Try aspirin and\na damp, luke-warm sponge.")
  19. zconclusion("disease","=","spinal mentingitus","The disease is SPINAL MENINGITUS.  This is a very serious\ndisease that can KILL or leave seriously incapacitated.\nYou should apply the ..... serum and have hospital\nconfinement....Also, isolate family members.")
  20. zreason("temperature","Temperature helps determine if the patient is sick.")
  21. zsymbolic("runny nose","Does the patient have a runny nose?",["yes","no"],"sgl")
  22. zsymbolic("aches","Does the patient have aches and pains?",["yes","no"],"sgl")
  23. zsymbolic("disease","",["flu","cold","none","spinal mentingitus"],"mlt")
  24. zsymbolic("back ache","Patient have severe backache?",["yes","no"],"mlt")
  25. zsymbolic("prescription","",["rest and liquids","aspirin","vitamin C","Spinal men. vaccine #7.8"],"mlt")
  26. zsymbolic("precautions","Take precautions when the patient's temperature is too high.",["take precautions","don't take precautions"],"sgl")
  27. zsymbolic("large person","",["yes","no"],"sgl")
  28. znumeric("temperature","Temperature of patient?")
  29. znumeric("height","How tall is patient (in feet)?")
  30. znumeric("weight of person","What is the patient's weight (in pounds)?")
  31.